package demo;

import javanet.communication.JavaNETCommunicationFactory;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Singleton
@Startup
public class StartUpSingleton {

	@EJB
	private JavaNETCommunicationFactory factory;
	
	@EJB
	private DemoDataStore dataStore;
	
	@SuppressWarnings("unchecked")
	@PostConstruct
	public void initDemo() throws Exception
	{
		factory.registerListener(DemoListener.class);
		factory.setModuleName("javanet-demo");
		dataStore.init();
	}
}
